package com.comac.print.component.app.domain.gateway.enums;

import lombok.Getter;
import lombok.Setter;

import java.util.Arrays;

/**
 * @Description FO制造部门
 * @Author yy
 * @Date 2022/4/19 16:05
 */
public enum FoMfgDeptEnum {

    K1("1K", "1K(ARJ21事业部/C919事业部)"),
    K2("2K", "2K(ARJ21事业部/C919事业部)"),
    K8("8K", "8K(零件加工中心-钣金加工)"),
    K9("9K", "9K(工装制造车间)"),
    K12("12K", "12K(零件加工中心-数控机加)"),
    K11("11K", "11K(复合材料中心)"),
    K15("15K", "15K(零件加工中心-热表处理)"),
    K25("25K", "25K(凯飞事业部)"),
    K29("29K", "29K(零号车间)"),
    K34("34K", "34K(采供物流中心)"),
    K47("47K", "47K(维修交付中心)");

    @Getter
    @Setter
    private String code;
    @Getter
    @Setter
    private String description;

    FoMfgDeptEnum(String code, String description) {
        this.code = code;
        this.description = description;
    }


    /**
     * 通过code获取枚举值
     *
     * @param code
     * @return
     */
    public static FoMfgDeptEnum getFoMfgDeptEnumByCode(String code) {
        return Arrays.stream(FoMfgDeptEnum.values())
                .filter(foMfgDeptEnum -> foMfgDeptEnum.getCode().equals(code))
                .findFirst().orElse(null);
    }


}
